/*
 * To change this license header, choose License Headers in Project Properties.
 * To change this template file, choose Tools | Templates
 * and open the template in the editor.
 */

package com.agtranscontinental.dgs001.model;

import java.io.Serializable;
import java.util.List;
import javax.persistence.Basic;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.Id;
import javax.persistence.NamedQueries;
import javax.persistence.NamedQuery;
import javax.persistence.OneToMany;
import javax.persistence.Table;
import javax.validation.constraints.NotNull;
import javax.validation.constraints.Size;

/**
 *
 * @author ericson
 */
@Entity
@Table(name = "servicio_empresa")
@NamedQueries({
    @NamedQuery(name = "ServicioEmpresa.findAll", query = "SELECT s FROM ServicioEmpresa s"),
    @NamedQuery(name = "ServicioEmpresa.findByIdSvceps", query = "SELECT s FROM ServicioEmpresa s WHERE s.idSvceps = :idSvceps"),
    @NamedQuery(name = "ServicioEmpresa.findByNombSvceps", query = "SELECT s FROM ServicioEmpresa s WHERE s.nombSvceps = :nombSvceps")})
public class ServicioEmpresa implements Serializable {
    private static final long serialVersionUID = 1L;
    @Id
    @Basic(optional = false)
    @NotNull
    @Column(name = "id_svceps")
    private Integer idSvceps;
    @Size(max = 150)
    @Column(name = "nomb_svceps")
    private String nombSvceps;
    @OneToMany(mappedBy = "servicioEmpresa")
    private List<Empresa> empresaList;

    public ServicioEmpresa() {
    }

    public ServicioEmpresa(Integer idSvceps) {
        this.idSvceps = idSvceps;
    }

    public Integer getIdSvceps() {
        return idSvceps;
    }

    public void setIdSvceps(Integer idSvceps) {
        this.idSvceps = idSvceps;
    }

    public String getNombSvceps() {
        return nombSvceps;
    }

    public void setNombSvceps(String nombSvceps) {
        this.nombSvceps = nombSvceps;
    }

    public List<Empresa> getEmpresaList() {
        return empresaList;
    }

    public void setEmpresaList(List<Empresa> empresaList) {
        this.empresaList = empresaList;
    }

    @Override
    public int hashCode() {
        int hash = 0;
        hash += (idSvceps != null ? idSvceps.hashCode() : 0);
        return hash;
    }

    @Override
    public boolean equals(Object object) {
        // TODO: Warning - this method won't work in the case the id fields are not set
        if (!(object instanceof ServicioEmpresa)) {
            return false;
        }
        ServicioEmpresa other = (ServicioEmpresa) object;
        if ((this.idSvceps == null && other.idSvceps != null) || (this.idSvceps != null && !this.idSvceps.equals(other.idSvceps))) {
            return false;
        }
        return true;
    }

    @Override
    public String toString() {
        return "com.agtranconstinental.dgs001.model.ServicioEmpresa[ idSvceps=" + idSvceps + " ]";
    }
    
}
